#include <iostream>
#include <vector>
#include <math.h>
using namespace std;

int DivSum(int n)   
{
    int sum = 0;  //除本身外约数的和
    for(int i = 1; i < n; ++i){
        if(n % i == 0)
            sum += i;
    }
    return sum;
}

int main()
{
    int num;
    cin >> num;
    int retcnt = 0;
    for(int i = 2; i < num; ++i){
        if(DivSum(i) == i)
            ++retcnt;
    }
    cout << retcnt;
    return 0;
}